package com.zm.service;

import com.zm.bean.TestDoorRecordBean;
import com.zm.repositories.jpa.CabTestDoorRecordRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;

@Service
public class CabTestDoorRecordServiceImpl implements CabTestDoorRecordService {
    @Resource
    private CabTestDoorRecordRepository mRepository;

    @Override
    public Optional<TestDoorRecordBean> findById(Long aLong) {
        return mRepository.findById(aLong);
    }

    @Override
    public Page<TestDoorRecordBean> findAll(Pageable pageable) {
        return mRepository.findAll(pageable);
    }

    @Override
    public Page<TestDoorRecordBean> findAllByCabinetId(String iterable, Pageable pageable) {
        return mRepository.findAllByCabinetId(iterable, pageable);
    }

    @Override
    public TestDoorRecordBean save(TestDoorRecordBean mTestDoorRecordBean) {
        return mRepository.save(mTestDoorRecordBean);
    }

    @Override
    public List<TestDoorRecordBean> saveAll(List<TestDoorRecordBean> mList) {
        return mRepository.saveAll(mList);
    }

}
